package com.sbp.message.api.entity;

public enum MessageType {
	MESSAGE_QUEUE(1, "队列"),
	MESSAGE_TOPIC(2, "订阅话题");

	protected int value;
	protected String desc;

	MessageType(int value, String desc) {
		this.value = value;
		this.desc = desc;
	}

	public int getValue() {
		return value;
	}
	public String getDesc() {
		return desc;
	}


	public static MessageType valueOf(int value) {
		MessageType[] list = MessageType.values();
		for (int i = 0; i < list.length; ++i) {
			if (list[i].value == value)
				return list[i];
		}
		return null;
	}
}
